<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>使用max()来返回两个给定的数中的较大的数</title>
</head>

<body>
    <p id="demo">单击按钮返回5到10之间的最大值。</p>
    <button onclick="myFunction()">点我</button>
    <script>
        function myFunction() {
            document.getElementById("demo").innerHTML = Math.max(5, 10);
        }
    </script>
</body>

</html>